﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Google.GData.Calendar.EventEntry>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    ListEvent
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        כל האירועים</h2>
    <table>
        <tr>
            <th>
            </th>
            <th>
                כותרת
            </th>
            <th>
                זמן
            </th>
            <th>
                תמונה
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%= Html.ActionLink("ערוך", "EditEvent", new { id=item.Uid.Value }) %>
                |
                <%= Html.ActionLink("מחק", "DeleteEvent", new { id=item.Uid.Value })%>
          <%if(item.WebContentLink != null && item.WebContentLink.WebContent != null){ %>
              <a href="<%= item.WebContentLink.WebContent.Url %>" >לפרטים</a> <%} %>
            </td>
            <td>
                <%= item.Title.Text %>
            </td>
            <td>
                <%
                    var time = item.Times.First();
                %>
                <%= Html.Encode(time.StartTime.ToString()) %>
                -
                <%= Html.Encode(time.EndTime.ToString()) %>
            </td>
            <td>
          <%if (item.WebContentLink != null)
            {
                Response.Write("<img src='" + item.WebContentLink.HRef + "' width=100 height=100 />");
            }%>
            </td>
        </tr>
        <% } %>
    </table>
    <p>
        <%= Html.ActionLink("צור אירוע חדש", "CreateEvent") %>
    </p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
